package com.resrun.enums;

import lombok.Getter;

@Getter
public enum RequestStateEnum {

    INIT((byte) 0, "未审核"),
    PASS((byte) 1, "审核通过"),
    NOT_PASS((byte) 2, "审核不通过"),
    ISSUE((byte) 3, "已颁发证书"),
    DOWNLOAD((byte) 4, "已下载证书");


    private final byte state;
    private final String desc;

    RequestStateEnum(byte state, String desc) {
        this.state = state;
        this.desc = desc;
    }

    public static RequestStateEnum of(byte state) {
        for (RequestStateEnum requestStateEnum : RequestStateEnum.values()) {
            if (requestStateEnum.state == state) {
                return requestStateEnum;
            }
        }

        return null;
    }

}
